package com.mmy.dao.ship;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import com.mmy.domain.ship.VShipBase;

public interface VShipBaseRepository extends JpaRepository<VShipBase, Integer> {

	/*
	 * 根据name查找
	 */
	@Query(value = "select *  from vShipBase where cShipName like %:strShipName%", nativeQuery = true)
	List<VShipBase> findByName(@Param("strShipName") String strShipName);

	/*
	 * 根据id查找
	 */
	@Query(value = "select *  from vShipBase where iShipID = :iShipID", nativeQuery = true)
	VShipBase findByID(@Param("iShipID") int iShipID);

}
